import axios from 'axios'

// axios的基础封装
const httpInstance = axios.create({
  baseURL: "http://127.0.0.1:8000",
  timeout: 5000,
})

// 拦截器
 // axios请求拦截器
httpInstance.interceptors.request.use(config => {
  return config
}, e => Promise.reject(e))

httpInstance.interceptors.response.use(res => res.data, e => {
  return Promise.reject(e)
})

export default httpInstance
